package test.h0819;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n<=0){
            System.out.println(0);
            return;
        }
        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int[][] intervals = new int[n][2];
        intervals[0][0] = 0;
        intervals[0][1] = arr[0];
        for (int i = 1; i < n; i++) {
            intervals[i][0] = 100 * i - arr[i];
            intervals[i][1] = 100 * i + arr[i];
        }
        getRes(intervals);
    }

    private static void getRes(int[][] intervals) {
        Arrays.sort(intervals, Comparator.comparingInt(a->a[0]));
        int n = intervals.length;
        int ans = 0;
        int end = intervals[0][1];
        for (int i = 1; i < n; i++) {
            if (end>=intervals[i][0]){
                end=Math.max(intervals[i][1],end); //注意这里选择更大范围
                continue;
            }
            ans+=intervals[i][0]-end;
            end=intervals[i][1];
        }
        System.out.println(ans);
    }
}
